package com.example.administrator.myweiyue.ui.module;

import android.app.Application;

import com.google.gson.Gson;

import javax.inject.Singleton;

import dagger.Module;
import dagger.Provides;

/**
 * Created by Administrator on 2018-01-23.
 */
@Module
public class AppModule {
    private Application mApplication;


    public AppModule(Application application){
        this.mApplication = application;
    }

    //全局单例
    @Provides
    @Singleton
    public Gson provideGson(){
        return  new Gson();
    }

    @Provides
    @Singleton
    Application provideApplication() {
        return mApplication;
    }

//    //全局单例SharedPreferences
//    @Provides
//    @Singleton
//    SharedPreferences provideSharedPreferences(Application application) {
//        return application.getSharedPreferences("spfile", Context.MODE_PRIVATE);
//    }




}
